﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
using ankietyzacja.Logic;

namespace ankietyzacja
{
    public partial class SurveyResultPrint : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
                if (Session["SurveyResult"] != null)
                {
                    PlaceHolder placeHolder = Session["SurveyResult"] as PlaceHolder;

                    MainPlaceHolder.Controls.Add(placeHolder);

                    foreach (Control control in ControlFinder.FlattenChildren(MainPlaceHolder).OfType<LinkButton>())
                    {
                        control.Visible = false;
                    }

                    foreach (Control control in ControlFinder.FlattenChildren(MainPlaceHolder).OfType<Button>())
                    {
                        control.Visible = false;
                    }

                }
                else
                {
                    throw new AccessViolationException("Brak danych do wydruku");
                }
        }
    }
}